Enable Error Display for PHP on cPanel
Sometimes when you are working with a PHP script on your website, you may need to debug a problem. By default your server will have PHP error display turned off for security reasons, but you can temporarily enable error display if you need it. Here's how to do it:
⚠️ Please be aware that some PHP scripts suppress or re-route errors regardless of your settings below. Check with your PHP script documentation to see where error messages get logged if the steps below don't work. You may need to turn on error reporting or logging in the admin area/config file for the script you want to debug.
-
Log into your cPanel account.
-
Look for the MultiPHP INI Editor in the Software section of cPanel.
-
Click on the Editor Mode tab at the top of this screen.
-
Select the domain or subdomain you want to activate error reporting within. The domain or subdomain you pick should be the one that the PHP script is running in.
-
The editor window may have items listed in it, or it may be blank. Find and edit the following lines as shown (or add them if they don't exist)
display_errors = On
error_reporting = E_ALL✅ The error_reporting line above will show all errors, notices and warnings for PHP scripts in that domain or subdomain. You can use one or more constants listed here separated by an ampersand (&) if you want to fine-tune the types of errors that get reported.
-
Click Save to apply the changes you've just made.
Now you can access your PHP script and debug it. The errors you are looking for may be displayed on screen, written to an error_log file in the script's main directory or where ever the script chooses to write such errors (perhaps a log accessible from the admin area of the script).
⚠️ Once you have fixed the issues reported by your PHP script, make sure you disable error reporting by going into the editor in cPanel and set display_errors = Off